how to find critical values of f(x)